package com.autocloud.model.security;

import com.autocloud.model.Base;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author zhongwb
 * @version 1.0
 * @description
 * @date 2019/12/14 5:31 下午
 */
@Entity
@Data
@Accessors(chain = true)
@Table(name = "sys_organization_person")
public class Person extends Base {

    private String organization;
    private String station;
    private int level;

    private String email;
    private String phone;
    private String wechat;
    private String idcard;
    private String address;
    private String avatar;
    private String gender;
    private String birthdate;

    public static Person of(String title, String id) {
        Person person = new Person();
        person.setId(id);
        person.setTitle(title);
        person.setRanks(getRankIncrement());
        return person;
    }

    public static Person of(String title, String id, String station, String organization, int level) {
        Person person = new Person();
        person.setId(id);
        person.setTitle(title);
        person.setStation(station);
        person.setOrganization(organization);
        person.setLevel(level);
        person.setRanks(getRankIncrement());
        return person;
    }


}
